// 所有模块都通过 define 来定义
define(function(require, exports, module) {

	// 通过 require 引入依赖
	require('jquery');
	require('./css/upload.css');
	require('./src/default.css');
	require('./src/kindeditor-min.js');
	require.async('./src/lang/zh_CN.min.js');
	
	exports.run = function(config){
		var uploadurl = '/material/image/upload';
		var editor = KindEditor.editor({
			uploadJson : uploadurl,
			allowFileManager : true,
		});
		
		
		$('#uploadimg_m').click(function(){
			
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					showRemote : false,
					imageUrl : $('#img_id').val(),
					clickFn : function(url) {
						//$(config.showdom).val(url);
						$('#fengmian').val(url);
						$('#spic_img').html('<img src="'+url+'">');
						editor.hideDialog();
					}
				});
			});
			
		});
	
	}
	

});